<template>
	<view>
		<image class="servicebg" src="@/static/servicebg.png" mode="aspectFill"></image>
		<page-head :title="'邀请好友'" :bgColor="`transparent`" :headtype="2"></page-head>
		<view class="sercode">
			<view class="sercode-title">邀请二维码</view>
			<!-- {{ datas.invite_code }} -->
			<view class="sercode-code marginAuto">
				<image style="width:450rpx;height:450rpx;" :src="apifun.URLimg+ datas.qrcode" mode="aspectFill"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				apifun:this.apifun,
				datas:{}
			};
		},
		onLoad() {
			this.initdata()
		},
		methods: {
			initdata(){
				let sendData = {};
				this.apifun.unirequest('/api/User/getUserQrcode','post',sendData,(res)=>{
					console.log(res)
					if(res.code === 200){
						let datas = res.data;
						this.datas = datas;
					}else{
						this.apifun.toast(res.msg)
					}
				})
			}
		},
	};
</script>

<style scoped lang="scss">
	.servicebg{
		position: fixed;
		top: 0;
		left: 0;
		z-index: 0;
		width: 100vw;
		height: 100vh;
	}
	.sercode{
		position:absolute;
		z-index: 10;
		top:300rpx;
		width: 100%;
		.sercode-title{
			font-size: 30rpx;
			color: #333333;
			text-align: center;
			line-height: 80rpx;
			margin-bottom:50rpx;
		}
		.sercode-code{
			width:450rpx;
			height: 450rpx;
			image{
				border-radius: 10rpx;
			}
		}
	}
	
</style>